import { Router } from 'express';
import { DictTypeController } from '../controllers/dictTypeController';
import { authMiddleware } from '../middlewares/authMiddleware';
export default (): Router => {
  const router = Router();
  const dictTypeController = new DictTypeController();

  // 公开路由：注册和登录

  // // 受保护的路由：需要登录才能访问
  router.post('/add', authMiddleware, dictTypeController.add);
  router.delete('/delete', authMiddleware, dictTypeController.delete);
  router.get('/getDictTypeList', authMiddleware, dictTypeController.getDictTypeList);
  router.put('/update', authMiddleware, dictTypeController.update);
  router.get('/findByCode', authMiddleware, dictTypeController.findByCode);
  return router;
};